package com.lanou.connotationjoke.db;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.connotationjoke.db.HomeJokeEntity;
import com.lanou.connotationjoke.db.HomeVideoEntity;
import com.lanou.connotationjoke.db.HomePictureEntity;
import com.lanou.connotationjoke.db.HomeSubscriptionEntity;
import com.lanou.connotationjoke.db.HomeRecommendationEntity;
import com.lanou.connotationjoke.db.HomeCollectEntity;

import com.lanou.connotationjoke.db.HomeJokeEntityDao;
import com.lanou.connotationjoke.db.HomeVideoEntityDao;
import com.lanou.connotationjoke.db.HomePictureEntityDao;
import com.lanou.connotationjoke.db.HomeSubscriptionEntityDao;
import com.lanou.connotationjoke.db.HomeRecommendationEntityDao;
import com.lanou.connotationjoke.db.HomeCollectEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig homeJokeEntityDaoConfig;
    private final DaoConfig homeVideoEntityDaoConfig;
    private final DaoConfig homePictureEntityDaoConfig;
    private final DaoConfig homeSubscriptionEntityDaoConfig;
    private final DaoConfig homeRecommendationEntityDaoConfig;
    private final DaoConfig homeCollectEntityDaoConfig;

    private final HomeJokeEntityDao homeJokeEntityDao;
    private final HomeVideoEntityDao homeVideoEntityDao;
    private final HomePictureEntityDao homePictureEntityDao;
    private final HomeSubscriptionEntityDao homeSubscriptionEntityDao;
    private final HomeRecommendationEntityDao homeRecommendationEntityDao;
    private final HomeCollectEntityDao homeCollectEntityDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        homeJokeEntityDaoConfig = daoConfigMap.get(HomeJokeEntityDao.class).clone();
        homeJokeEntityDaoConfig.initIdentityScope(type);

        homeVideoEntityDaoConfig = daoConfigMap.get(HomeVideoEntityDao.class).clone();
        homeVideoEntityDaoConfig.initIdentityScope(type);

        homePictureEntityDaoConfig = daoConfigMap.get(HomePictureEntityDao.class).clone();
        homePictureEntityDaoConfig.initIdentityScope(type);

        homeSubscriptionEntityDaoConfig = daoConfigMap.get(HomeSubscriptionEntityDao.class).clone();
        homeSubscriptionEntityDaoConfig.initIdentityScope(type);

        homeRecommendationEntityDaoConfig = daoConfigMap.get(HomeRecommendationEntityDao.class).clone();
        homeRecommendationEntityDaoConfig.initIdentityScope(type);

        homeCollectEntityDaoConfig = daoConfigMap.get(HomeCollectEntityDao.class).clone();
        homeCollectEntityDaoConfig.initIdentityScope(type);

        homeJokeEntityDao = new HomeJokeEntityDao(homeJokeEntityDaoConfig, this);
        homeVideoEntityDao = new HomeVideoEntityDao(homeVideoEntityDaoConfig, this);
        homePictureEntityDao = new HomePictureEntityDao(homePictureEntityDaoConfig, this);
        homeSubscriptionEntityDao = new HomeSubscriptionEntityDao(homeSubscriptionEntityDaoConfig, this);
        homeRecommendationEntityDao = new HomeRecommendationEntityDao(homeRecommendationEntityDaoConfig, this);
        homeCollectEntityDao = new HomeCollectEntityDao(homeCollectEntityDaoConfig, this);

        registerDao(HomeJokeEntity.class, homeJokeEntityDao);
        registerDao(HomeVideoEntity.class, homeVideoEntityDao);
        registerDao(HomePictureEntity.class, homePictureEntityDao);
        registerDao(HomeSubscriptionEntity.class, homeSubscriptionEntityDao);
        registerDao(HomeRecommendationEntity.class, homeRecommendationEntityDao);
        registerDao(HomeCollectEntity.class, homeCollectEntityDao);
    }
    
    public void clear() {
        homeJokeEntityDaoConfig.getIdentityScope().clear();
        homeVideoEntityDaoConfig.getIdentityScope().clear();
        homePictureEntityDaoConfig.getIdentityScope().clear();
        homeSubscriptionEntityDaoConfig.getIdentityScope().clear();
        homeRecommendationEntityDaoConfig.getIdentityScope().clear();
        homeCollectEntityDaoConfig.getIdentityScope().clear();
    }

    public HomeJokeEntityDao getHomeJokeEntityDao() {
        return homeJokeEntityDao;
    }

    public HomeVideoEntityDao getHomeVideoEntityDao() {
        return homeVideoEntityDao;
    }

    public HomePictureEntityDao getHomePictureEntityDao() {
        return homePictureEntityDao;
    }

    public HomeSubscriptionEntityDao getHomeSubscriptionEntityDao() {
        return homeSubscriptionEntityDao;
    }

    public HomeRecommendationEntityDao getHomeRecommendationEntityDao() {
        return homeRecommendationEntityDao;
    }

    public HomeCollectEntityDao getHomeCollectEntityDao() {
        return homeCollectEntityDao;
    }

}
